﻿<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<script type="text/javascript" src="../Scripts/jquery.js"></script>
<script type="text/javascript" src="../Scripts/Verify.js"></script>
<link href="../Styles/Public.css" rel="stylesheet" type="text/css" />
</head>
<body>
<h1>非空验证</h1>
<h2>概述</h2>
<div class="desc">
  <p>在控件设置参数 <strong>nullable</strong><strong>=&quot;false&quot;</strong>即可实现非空验证。</p>
  <p> 默认值为true。当为false时，控件会后自动显示红色<span class="red">*</span>号（如果设置star='false'则不显示）。该属性适用于所有控件，如文本录入、密码录入、文件上传、下拉选择框。</p>
  <p>&lt;input name=&quot;&quot; type=&quot;text&quot; <strong>nullable=&quot;false&quot;</strong>/&gt;</p>
</div>
<h2>示例</h2>
<h3>1、录入框的验证</h3>
<div class="desc">
  <fieldset>
    <legend>单行录入框</legend>
    <pre>&lt;form onsubmit=&quot;alert('验证成功');return false;&quot;&gt;<br />      &lt;p&gt; 账号1：<br />        &lt;input name=&quot;&quot; type=&quot;text&quot; <strong>nullable=&quot;false&quot;</strong> datatype=&quot;user&quot;/&gt;<br />      &lt;/p&gt;<br />      &lt;p&gt; 账号2：<br />        &lt;input name=&quot;&quot; type=&quot;text&quot; <strong>nullable=&quot;false&quot; star=&quot;false&quot;</strong>/&gt;（star=&quot;false&quot;不显示星号）<br />      &lt;/p&gt;<br />      &lt;p&gt;<br />        &lt;input type=&quot;submit&quot; name=&quot;button&quot; class=&quot;button&quot; value=&quot;验证表单&quot; verify=&quot;true&quot;/&gt;<br />      &lt;/p&gt;<br />    &lt;/form&gt;</pre>
    <form onsubmit="alert('验证成功');return false;">
      <p> 账号1：
        <input name="" type="text" nullable="false" datatype="user"/>
      </p>
      <p> 账号2：
        <input name="" type="text" nullable="false" star="false"/>（star="false"不显示星号）
      </p>
      <p>
        <input type="submit" name="button" class="button" value="验证表单" verify="true"/>
      </p>
    </form>
  </fieldset>
</div>
<div class="desc">
  <fieldset>
    <legend>多行录入框</legend>
    <pre>
 &lt;form onsubmit=&quot;alert('验证成功');return false;&quot;&gt;<br />    &lt;p&gt; 账号：<br />      &lt;textarea name=&quot;&quot; rows=&quot;3&quot;
        <strong>nullable=&quot;false&quot;</strong> datatype=&quot;user&quot;&gt;&lt;/textarea&gt;<br />    &lt;/p&gt;<br />    &lt;p&gt;<br />      &lt;input type=&quot;submit&quot; name=&quot;button&quot; 
      class=&quot;button&quot; value=&quot;验证表单&quot; verify=&quot;true&quot;/&gt;<br />    &lt;/p&gt;<br />  &lt;/form&gt;</pre>
    <form onsubmit="alert('验证成功');return false;">
      <p> 账号：
        <textarea name="" rows="3" nullable="false" datatype="user"></textarea>
      </p>
      <p>
        <input type="submit" name="button" class="button" value="验证表单" verify="true"/>
      </p>
    </form>
  </fieldset>
</div>
<h3>2、选择框的验证</h3>
<div class="desc">
  <fieldset>
    <legend>下拉选择框</legend>
    <pre> &lt;form onsubmit=&quot;alert('验证成功');return false;&quot;&gt;<br />      &lt;p&gt;学历：<br />      &lt;select name=&quot;select&quot; id=&quot;select&quot; nullable=&quot;false&quot; alt=&quot;请选择学历&quot;&gt;<br />        &lt;option value=&quot;&quot;&gt;--请选择--&lt;/option&gt;<br />        &lt;option value=&quot;5&quot;&gt;硕士&lt;/option&gt;<br />        &lt;option value=&quot;4&quot;&gt;本科&lt;/option&gt;<br />        &lt;option value=&quot;3&quot;&gt;专科&lt;/option&gt;<br />        &lt;option value=&quot;2&quot;&gt;中学&lt;/option&gt;<br />        &lt;option value=&quot;1&quot;&gt;小学&lt;/option&gt;<br />      &lt;/select&gt;<br />    &lt;/p&gt;<br />      &lt;p&gt;<br />        &lt;input type=&quot;submit&quot; name=&quot;button&quot;
        class=&quot;button&quot; value=&quot;验证表单&quot; verify=&quot;true&quot;/&gt;<br />      &lt;/p&gt;<br />    &lt;/form&gt;</pre>
    <form onsubmit="alert('验证成功');return false;">
      <p>学历：
      <select name="select" id="select" nullable="false" alt="请选择学历">
        <option value="">--请选择--</option>
        <option value="5">硕士</option>
        <option value="4">本科</option>
        <option value="3">专科</option>
        <option value="2">中学</option>
        <option value="1">小学</option>
      </select>
    </p>
      <p>
        <input type="submit" name="button" class="button" value="验证表单" verify="true"/>
      </p>
    </form>
  </fieldset>
</div>
<div class="desc">
  <fieldset>
    <legend>列表选择框</legend>
    <pre>&lt;form onsubmit=&quot;alert('验证成功');return false;&quot;&gt;<br />      &lt;p&gt;学历：<br />      &lt;select name=&quot;select&quot; size=&quot;4&quot; id=&quot;select&quot; nullable=&quot;false&quot; alt=&quot;请选择学历&quot;&gt;<br />        &lt;option value=&quot;&quot;&gt;--请选择--&lt;/option&gt;<br />        &lt;option value=&quot;5&quot;&gt;硕士&lt;/option&gt;<br />        &lt;option value=&quot;4&quot;&gt;本科&lt;/option&gt;<br />        &lt;option value=&quot;3&quot;&gt;专科&lt;/option&gt;<br />        &lt;option value=&quot;2&quot;&gt;中学&lt;/option&gt;<br />        &lt;option value=&quot;1&quot;&gt;小学&lt;/option&gt;<br />      &lt;/select&gt;<br />    &lt;/p&gt;<br />      &lt;p&gt;<br />        &lt;input type=&quot;submit&quot; name=&quot;button&quot; class=&quot;button&quot; value=&quot;验证表单&quot; verify=&quot;true&quot;/&gt;<br />      &lt;/p&gt;<br />    &lt;/form&gt;</pre>
    <form onsubmit="alert('验证成功');return false;">
      <p>学历：
      <select name="select" size="4" id="select" nullable="false" alt="请选择学历">
        <option value="">--请选择--</option>
        <option value="5">硕士</option>
        <option value="4">本科</option>
        <option value="3">专科</option>
        <option value="2">中学</option>
        <option value="1">小学</option>
      </select>
    </p>
      <p>
        <input type="submit" name="button" class="button" value="验证表单" verify="true"/>
      </p>
    </form>
  </fieldset>
</div>
<h3>3、文件域的验证</h3>
<div class="desc">
  <fieldset>
    <legend>文件上传</legend>
    <pre>&lt;form onsubmit=&quot;alert('验证成功');return false;&quot;&gt;<br />      &lt;p&gt;上传文件：<br />      &lt;input name=&quot;&quot; type=&quot;file&quot; fileallow=&quot;jpg|png&quot; nullable=&quot;false&quot;  class=&quot;fileinput&quot;/&gt;<br />    &lt;/p&gt;<br />      &lt;p&gt;<br />        &lt;input type=&quot;submit&quot; name=&quot;button&quot; class=&quot;button&quot; value=&quot;验证表单&quot; verify=&quot;true&quot;/&gt;<br />      &lt;/p&gt;<br />    &lt;/form&gt;</pre>
    <form onsubmit="alert('验证成功');return false;">
      <p>上传文件：
      <input name="" type="file" fileallow="jpg|png" nullable="false"  class="fileinput"/>
    </p>
      <p>
        <input type="submit" name="button" class="button" value="验证表单" verify="true"/>
      </p>
    </form>
  </fieldset>
</div>
</body>
</html>
